class Mark
  PROPERTIES = %w[id title link uploaded_at code category].each { |prop|
    attr_accessor prop
  }

  def initialize(hash = {})
    hash.each { |key, value|
      if PROPERTIES.member? key.to_s
        self.send("#{key}=", value)
      end
    }
  end
end